import { http } from '@/utils/axios/init'

// 查询应用
export function appLoadList(params) {
  return http.request({
    url: '/system/Rest/sysApp/queryList',
    method: 'get',
    params
  })
}

// 查询文件类型
export function fileExtension(params) {
  return http.request({
    url: '/doc/Rest/docFileInfo/getFileSuffixes',
    method: 'get',
    params
  })
}
// 上传文件(在线编辑)
export function uploadFileByFileUrl(params) {
  return http.request({
    url: `/doc/Rest/doc/file/uploadFileByFileUrl/false`,
    method: 'post',
    params
  })
}

// 根据projectId 查询项目详情--20240301-修改
export function getProjectDetailById(params) {
  return http.request({
    url: `/project/Rest/projectResearch/getByProjectId`,
    method: 'get',
    params: {
      allFlag: 1,
      ...params
    }
  })
}

// 批注
export function saveAnnotation(data) {
  return http.request({
    url: `/ctms/Rest/projectFileListItem/saveAnnotation`,
    method: 'post',
    data
  })
}

// 获取文件的base64
export function getFileBase64(params) {
  return http.request({
    url: `/doc/Rest/doc/file/getFileBase64`,
    method: 'get',
    timeout: 1000 * 10 * 6,
    params
  })
}

// 记录打印日志
export function setPrintLog(data) {
  return http.request({
    url: `/doc/Rest/doc/file/print`,
    method: 'post',
    data
  })
}
